/// _navbar.scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-

$navbarErrorHeight: 32px;

/**
 * Adjust padding of PacketFence logo. Expected height of logo is 30px.
 */
.navbar .brand {
  margin-left: 0;
  padding: floor(($navbarHeight - 30)/2) 20px;
  img {
    height: 32px;
  }
}

/**
 * Use nav-header in navbar but remove extra padding.
 */
.navbar .nav-header {
  padding-top: 0;
  padding-bottom: 0;
  i {
    font-size: 1rem;
  }
}

/**
 * Links under collapsable entries should take all space
 */
.nav .collapse a {
  display: block;
  width: 100%;
}

/**
 * Navbar in "danger" mode (readonly database)
 */
.navbar-inverse.navbar-error {
  .navbar-inner {
    // Simple stripes pattern for the background
    background-image: repeating-linear-gradient(-45deg,
      $errorBorder, $errorBorder .25em,
      $errorBackground 0, $errorBackground .75em);
  }
  // Change links color
  .nav > li > a {
    color: $errorText;
    text-shadow: none;
  }
  // Change active link color
  .nav > li > a:hover,
  .nav .active > a,
  .nav li.dropdown.open > .dropdown-toggle {
    background-color: $errorText;
    color: white;
  }
  .nav > li > a:hover,
  .nav > li > a:focus {
    border-top: 2px solid $errorText;
  }
  // Change caret color of dropdowns
  .nav li.dropdown > .dropdown-toggle .caret {
    border-bottom-color: $errorText;
    border-top-color: $errorText;
  }
  // Bottom row with error message
  .row-error {
    background-color: $errorText;
    border-top: 1px solid $errorBorder;
    color: lighten($errorBackground, 5%);
    text-align: center;
    height: $navbarErrorHeight;
    line-height: $navbarErrorHeight;
    a {
      color: $white;
      i {
        font-size: 1rem;
      }
    }
  }
}
// Because of additional error message bellow the main navbar, lower the content accordingly
body.navbar-error {
  padding-top: $navbarHeight + $navbarErrorHeight;
  .sidenav {
    top: $navbarHeight + $navbarErrorHeight;
  }
}
